// GradeRepository.java 成绩仓库接口
package com.example.studentmanagement2.repository.Repository;

import com.example.studentmanagement2.dto.CourseAverageDTO;
import com.example.studentmanagement2.dto.GradeDetail;
import com.example.studentmanagement2.model.Grade;
import java.util.List;

public interface GradeRepository {
    Grade save(Grade grade);
    List<Grade> findByStudentId(String studentId);
    List<Grade> findByCourseId(String courseId);
    boolean existsByStudentAndCourse(String studentId, String courseId);
    void update(Grade grade);

    List<GradeDetail> findGradeDetails(String studentId);
    List<GradeDetail> findByCourseWithDetails(String courseId);


    List<CourseAverageDTO> findClassAverages(String className);
}